package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;

/**
 * <p>
 * 职务
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
@TableName("tm_position")
public class PositionPO extends DMSBasePO<PositionPO> {

    private static final long serialVersionUID = 1L;

    /**
     * POSITION_ID
     */
        @TableId(value = "POSITION_ID", type = IdType.AUTO)
        private Integer positionId;
    /**
     * 经销商代码
     */
    @TableField("DEALER_CODE")
    private String dealerCode;
    /**
     * 职务代码
     */
    @TableField("POSITION_CODE")
    private String positionCode;
    /**
     * 职务名称
     */
    @TableField("POSITION_NAME")
    private String positionName;
    /**
     * 职务描述
     */
    @TableField("POSITION_DESC")
    private String positionDesc;
    /**
     * 是否有效
     */
    @TableField("IS_VALID")
    private Integer isValid;
    @TableField("ORGANIZATION_ID")
    private Integer organizationId;
    @TableField("POSITION_TYPE")
    private Integer positionType;
    /**
     * 数据来源
     */
    @TableField("DATA_SOURCES")
    private Integer dataSources;
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;

    public PositionPO() {
        super();
    }


    public Integer getPositionId() {
        return positionId;
    }

    public void setPositionId(Integer positionId) {
        this.positionId = positionId;
    }

    public String getDealerCode() {
        return dealerCode;
    }

    public void setDealerCode(String dealerCode) {
        this.dealerCode = dealerCode;
    }

    public String getPositionCode() {
        return positionCode;
    }

    public void setPositionCode(String positionCode) {
        this.positionCode = positionCode;
    }

    public String getPositionName() {
        return positionName;
    }

    public void setPositionName(String positionName) {
        this.positionName = positionName;
    }

    public String getPositionDesc() {
        return positionDesc;
    }

    public void setPositionDesc(String positionDesc) {
        this.positionDesc = positionDesc;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public Integer getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(Integer organizationId) {
        this.organizationId = organizationId;
    }

    public Integer getPositionType() {
        return positionType;
    }

    public void setPositionType(Integer positionType) {
        this.positionType = positionType;
    }

    public Integer getDataSources() {
        return dataSources;
    }

    public void setDataSources(Integer dataSources) {
        this.dataSources = dataSources;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.positionId;
    }

    @Override
    public String toString() {
        return "PositionPO{" +
        "positionId=" + positionId +
        ", dealerCode=" + dealerCode +
        ", positionCode=" + positionCode +
        ", positionName=" + positionName +
        ", positionDesc=" + positionDesc +
        ", isValid=" + isValid +
        ", organizationId=" + organizationId +
        ", positionType=" + positionType +
        ", dataSources=" + dataSources +
        ", isDeleted=" + isDeleted +
        "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "positionId");
    }


}
